import React, { Component } from 'react'
import userCss from './css/user.module.css'
import Recommend from '../../publicComponents/recommend/recommend.jsx'
import axios from 'axios'
export default class user extends Component {
    state = {
        dingLue: [],
    }
    componentDidMount() {
         axios(`/tyj/detail?brandName='匹克体育'`).then((res) => {
            // console.log(res.data);
            this.setState({dingLue:res.data})
        })
        const data = window.JSON.parse(window.localStorage.getItem("user"))
        this.setState({
            ...data
        })
    }

    render() {
        const dingLueFn = () => {
            return (
                this.state.dingLue.map((el, index) => {
                    return <div className={userCss.brand} >
                        <img src={el.logo} alt="" className={userCss.touxiang} />
                        <div className={userCss.text}>
                            <div className={userCss.name}>{el.brandName}</div>
                            <p className={userCss.miaoshu}>{el.summary}</p>
                            <span className={userCss.hangye}>行业：{el.type}</span>
                            <span className={userCss.city}>城市：{el.city}</span>
                        </div>
                        <div className={userCss.right}>
                            <div className={userCss.fensi_box}>
                                <div className={userCss.fsnum}>{el.fans}</div>
                                <div className={userCss.fensi}>粉丝</div>
                            </div>
                        </div>
                    </div>
                })

            )
        }
        const edit=()=>{

        }
        const mask=()=>{
            
        }
        return (
           
            <div className={userCss.body} >
                 {mask()}
                <div className={userCss.title} onClick>
                    <div >
                        <img src={this.state.img} className={userCss.img} alt="" />
                    </div>
                    <div className={userCss.content}>
                        <h2>{this.state.name}</h2>
                        <p>{this.state.introduction}</p>
                    </div>

                </div>
                <div className={userCss.nav}>
                    <div>
                        <div className={userCss.navTitle}>
                            <span className={userCss.span}>订阅</span>
                            <span className={userCss.span}>点赞</span>
                            <span className={userCss.span}>评论</span>
                            <span className={userCss.span}>收藏</span>
                        </div>
                        <div>
                            {dingLueFn().map((el)=>{
                                return el
                            })}
                        </div>
                    </div>
                    <Recommend />
                </div>
            </div>
        )
    }
}
